var express = require('express');
var router = express.Router();

router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});


/* 记账本列表 */
router.get('/account', function (req, res, next) {
  // res.send('记账本列表')
  res.render('list')
});

/* 添加账本 */
router.get('/account/create', function (req, res, next) {
  // res.send('添加记录')
  res.render('create');
});

// 处理添加账单逻辑
router.post('/account/create', function (req, res, next) {
  // 获取详情
  console.log(req.body)
  res.send('添加记录')
});

module.exports = router;
